
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<script charset="utf-8" th:src="@{/js1/jquery.min.js}" ></script>
<script charset="utf-8" th:src="@{/js1/global.js}" ></script>
<script charset="utf-8" th:src="@{/js1/bootstrap.min.js}" ></script>
<script charset="utf-8" th:src="@{/js1/template.js}" ></script>
	<link rel="stylesheet" th:href="@{/css1/orderstyle.css}"/>
	<link rel="stylesheet" th:href="@{/css1/common.css}" >
<link rel="stylesheet" th:href="@{/css1/bootstrap.css}" >
<link rel="stylesheet" th:href="@{/css1/style.css}" >
<link rel="stylesheet" th:href="@{/css1/member.css}" >
<link rel="stylesheet" th:href="@{/css1/order3.css}" ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="yes" name="apple-touch-fullscreen">
<meta content="telephone=no" name="format-detection">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1;user-scalable=no;">
<script charset="utf-8" src="js/shopCart.js?v=01291"></script>
<title>订单详情</title>
</head>
<body>
<div class="fanhui_cou">
	<div class="fanhui_1"></div>
	<div class="fanhui_ding">顶部</div>
</div> <header class="header header_1">
    <div class="fix_nav">
        <div class="nav_inner">
            <a class="nav-left back-icon" href="javascript:history.back();">返回</a>
            <div class="tit">当前订单</div>
        </div>
    </div>
</header>
<div class="container ">
	<section class="aui-flexView">

		<section class="aui-scrollView">
			<div class="aui-flex aui-flex-context">
				<input type="hidden" value="${order.id}" id="orderid">
				<div class="aui-flex-box">
					<h2>下单成功</h2>
					<h3>预计付款成功后12个小时内发货</h3>
				</div>
				<div class="aui-assemble-img">
					<img src="images/time.png" alt="">
				</div>
			</div>
			<div class="aui-flex">
				<div class="aui-address-img">
					<img src="images/add.png" alt="">
				</div>
				<div class="aui-flex-box">
					<h5 th:text="${order.addr}"></h5>
				</div>
			</div>
			<div class="divHeight"></div>
			<div class="aui-flex b-line">
				<div class="aui-address-logo">
					<img src="images/user-logo-003.png" alt="">
				</div>
				<div class="aui-flex-box">
					<h5>茅台酒镇</h5>
				</div>
				<div class="aui-address-arrow"></div>
			</div>






<ul>
	<li th:each="orderItem,stat:${order.orderItemList}">
			<div class="aui-flex aui-flex-four">
				<div class="aui-flex-add">
					<img th:src="${orderItem.product.image}" alt="">
				</div>
				<div class="aui-flex-box">
					<p th:text="${orderItem.product.title}"></p>
					<p class="b-line" style="color:#999"  th:text="${orderItem.count}"></p>
					<p class="b-line" style="color:#999"  th:text="${orderItem.subTotal}"></p>
				</div>
			</div>
			<div class="aui-flex aui-flex-four" style="padding-top:0">
				<div class="aui-flex-box">
					<button>申请退款</button>
					<button class="aui-btn-line">拼团详情</button>
				</div>
			</div>
	</li>
</ul>



			<div class="aui-flex b-line">
				<div class="aui-flex-box">
					<h6>需付款: ￥<em th:text="${order.total}"></em> <i>(免运费)</i></h6>
				</div>
			</div>
			<div class="aui-list-box">
				<a href="javascript:;" class="aui-flex aui-flex-right">
					<div class="aui-flex-icon-img">
						<img th:src="@{/img/icon-news.png}"  alt="">
					</div>
					<div class="aui-flex-box">
						<h4>联系卖家</h4>
					</div>
				</a>
				<a href="javascript:;" class="aui-flex">
					<div class="aui-flex-icon-img">
						<img th:src="@{/img/icon-phone.png}"  alt="">
					</div>
					<div class="aui-flex-box">
						<h4>拨打电话</h4>
					</div>
				</a>
			</div>
			<div class="divHeight"></div>
			<div class="aui-flex">
				<div class="aui-flex-box">
					<h4>订单编号: <em th:text="${order.name}">78302164057630000088</em></h4>
					<h4>下单时间: <em th:text="${order.orderTime}">2018-11-22 23:12:22</em></h4>
				</div>
			</div>
		</section>
	</section>

</div>


<div class="fixed-foot">
<div class="fixed_inner">
    <div class="pay-point">
        <div class="icheck pull-left mr10">
        </div>
         <p>合计：<em class="red f22">¥<span id="totalPrice" th:text="${order.total}"></span></em></p>
    </div>
    <div class="buy-btn-fix">
        <a href="javascript:weixinpay();" class="btn btn-danger btn-buy">微信支付</a>
    </div>
</div>
</div>
<div class="clear"></div>
<script type="text/javascript">



    function weixinpay() {
        var totalPrice=$("#totalPrice").val();
        var orderid=$("#orderid").val();
        $.ajax({
            url: "/mall/weixinpay/weixinpayhandler.do",
            data: {
                "spbill_create_ip": REMOTE_ADDR,
                "total_fee": totalPrice*100,
                "orderid": orderid
			},
            type: 'post',
            async: true,
            dataType: 'json',
            error: function (data) {
            },
            success: function (data) {

                if (data!=null&&data!=undefined&&data!="") {
                    onBridgeReady(data);
                    return;
                } else {
                    alert("系统异常,稍后再试");
                    return false;
                }

            }
        });
    }



        function onBridgeReady(data){

        WeixinJSBridge.invoke(
            'getBrandWCPayRequest', {
                "appId":data.appId,     //公众号名称，由商户传入
                "timeStamp":data.timeStamp,         //时间戳，自1970年以来的秒数
                "nonceStr":data.nonceStr, //随机串
                "package":data.package,
                "signType":data.signType,         //微信签名方式：
                "paySign":data.paySign //微信签名
            },
            function(res){
                if(res.err_msg == "get_brand_wcpay_request:ok" ){
                    alert("支付成功");
                    // 使用以上方式判断前端返回,微信团队郑重提示：
                    //res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
                }
            });
    }
</script>
</body></html>
<SCRIPT Language=VBScript><!--

//--></SCRIPT>